<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"  %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>SecStep</title>
<link href="<%=path%>/static/usercss/css/all.css?jejwej33we" rel="stylesheet" type="text/css">
<jsp:include page="/WEB-INF/web/includ/header.jsp"></jsp:include>

<body>
<c:set value="${requestScope.mailcode }" var="mailcode"></c:set>
<section>
<div class="wrap">
    <div id="register">
      <div class="logo"><img src="<%=path %>/static/usercss/images/registerlogo.png" width="300" height="50" alt="分类搜索"></div>
      <div class="respont">
        <h1>重置密码</h1>
        <form action="<%=path %>/web/userLogin/changeThird" method="post" id="form">
          <ol>
            <li>
             	 已经将验证码发送至${mailbox }
            </li>
            <li>
              <input id="mailBoxCode" name="mailCode" type="text" aria-label="输入验证码" placeholder="输入验证码">
              <label id="message" style="display: none;">验证码错误。<a id="return" href="javascript:void(0);">申请重新发送验证码。</a></label>
            </li>
            <li>
              <input class="submit" name="input6" type="submit" value="验证">
            </li>
            <li>如果邮箱不能使用请联系网站管理员<a href="mailto:webmaster@fenlaji.com">webmaster@fenlaji.com</a></li>
          </ol>
        </form>
      </div>
    </div>
  </div>
</div>
</section>
  <jsp:include page="/WEB-INF/web/includ/footer.jsp"></jsp:include>

  <script type="text/javascript">
  var x = false;
  $(function() {
	  $("#mailBoxCode").blur(function() {
			$.get("<%=path%>/web/userLogin/mailCode",{},function(mes){
				var str1 = $(this).val();			
				
				if(str1.toLowerCase() == mes.toLowerCase())
				{
					x=true;					
				}
				else{
				 $("#message").css("display","block");
					x=false;				
				}	
			}.bind(this))			
		});
	  
	  $("#form").submit(function() {
			return x;
		})
});
	
  $(function() {
	$("#return").click(function() {
			var mailbox = "${mailbox}";
			
		 $.post("<%=path%>/web/userLogin/sendEmail",
				 {mailbox:mailbox},
				 function(mes){
			 
		 })
	})
})
  
  
  </script>
</body>
</html>
